package com.xuecheng.content.api;

import com.xuecheng.content.model.dto.BindTeachPlanMediaDto;
import com.xuecheng.content.model.po.CourseTeacher;
import com.xuecheng.content.service.CourseTeacherService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class CourseTeacherController {
    @Resource
    private CourseTeacherService courseTeacherService;
    @GetMapping("/courseTeacher/list/{courseId}")
      public List<CourseTeacher> getCourseTeacher(@PathVariable Long courseId){
              return courseTeacherService.getCourseTeacher(courseId);
      }

      @PostMapping("/courseTeacher")
    public CourseTeacher addCourseTeacher(@RequestBody CourseTeacher courseTeacher){
        return courseTeacherService.addCourseTeacher(courseTeacher);
      }
      @PutMapping("/courseTeacher")
    public CourseTeacher update(@RequestBody CourseTeacher courseTeacher){
        return courseTeacherService.updateCourseTeacher(courseTeacher);
      }
      @DeleteMapping("/courseTeacher/course/{courseId}/{id}")
    public void deleteCourseTeacher(@PathVariable Long courseId,@PathVariable Long id){
        courseTeacherService.deleteCourseTeacher(courseId,id);
      }

}
